package com.ruoyi.database.controller;



import com.ruoyi.database.service.DataSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataSourceController {


    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    @Autowired
    private DataSourceService dataSourceService;

    @GetMapping("/tset")
    public void tset(){

        dataSourceService.performDatabaseOperations();
    }

    @PostMapping("/add")
    public void addDataSource(@RequestParam String key) {

        dataSourceService.addDataSource(key);
    }




}
